package com.zhuss.black.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.black.black.DetailBlackAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.black.db.dao.ext.BlackAppendDao;


/**
 * 查询黑名单Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("blackAppendRead")
public class BlackAppendRead {
	
	@Autowired
	private BlackAppendDao blackAppendDao;
	
	
	public List<DetailBlackAppendVo> listByType(Integer type, Long blackId, Long creatorId) {
		List<DetailBlackAppendVo> list = blackAppendDao.listByType(type, blackId, creatorId);
		return list;
	}
	
	public DetailBlackAppendVo getByType(Integer type, Long blackId, Long creatorId) {
		DetailBlackAppendVo result = blackAppendDao.getByType(type, blackId, creatorId);
		return result;
	}
	
	/**
	 * 黑名单Append详情
	 * @param blackAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long blackAppendId) throws WpsException {
		Object result = blackAppendDao.detail(blackAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
